home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Utilities / Text and Speech / UUTool / uu engine / UUGlue.c < prev    next >
Text File  |  1991-06-09  |  1KB  |  77 lines

  1. /*
  2. **    Project:    uu**code engine
  3. **    Author:        Bernhard S. Wieser
  4. **    Module:        uuglue.c
  5. **    Date:        5/19/91
  6. **    Revised:    6/1/91
  7. **                6/8/91
  8. **    Version:    1.0.2
  9. **
  10. **    Preface:
  11. **        uu**code engine is © by Bernhard S. Wieser and Octavian Micro
  12. **    development, all rights reserved.  Please read the accompanying
  13. **    licensing agreement before use.
  14. */
  15. #include "UUGlue.h"
  16.  
  17. /*
  18. **    UULoad
  19. **        Load engine, table, move them high and lock them.
  20. **
  21. **    Parameters
  22. **        none
  23. **
  24. **    Returns
  25. **        resource or memory errors
  26. */
  27. pascal OSErr UULoad(
  28.     Handle    *table,    /* the base of the translate table */
  29.     Handle    *engine    /* the base of the engine resource */
  30.     )
  31. {
  32.     OSErr    err;
  33.     
  34.     err = 0;
  35.     *table = GetResource('HEXA', 128);
  36.     if(*table) {
  37.         *engine = GetResource('UENG', 128);
  38.         if(*engine) {
  39.             MoveHHi(*table);
  40.             MoveHHi(*engine);
  41.             HLock(*table);
  42.             HLock(*engine);
  43.             }
  44.         else {
  45.             err = ResError();
  46.             ReleaseResource(*table);
  47.             }
  48.         }
  49.     else {
  50.         err = ResError();
  51.         }
  52.     return(err);
  53. }
  54.  
  55. /*
  56. **    UUnload
  57. **        Get rid of the uu resources.
  58. **
  59. **    Parameters
  60. **        none
  61. **
  62. **    Returns
  63. **        nothing
  64. */
  65. pascal void UUnload(
  66.     Handle    table,    /* the base of the translate table */
  67.     Handle    engine    /* the base of the engine resource */
  68.     )
  69. {
  70.     OSErr err;
  71.     
  72.     HUnlock(table);
  73.     HUnlock(engine);
  74.     ReleaseResource(table);
  75.     ReleaseResource(engine);
  76. }
  77.